package d4_map;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class cnest {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Map<String, ArrayList<String>> map = new HashMap<>();
        Collections.addAll(list, "a", "b", "c");
        map.put("A", list);

        Collections.addAll(list, "a", "b", "c");
        map.put("B", list);

        ArrayList<String> list2 = new ArrayList<>();
        Collections.addAll(list2, "e", "f", "g");
        map.put("C", list2);

        System.out.println(map);
        System.out.println(map.get("A"));

        map.forEach((k,v)->{
            System.out.println(k+v);
        });
    }
}
